#pragma once

#include "ImageCores/xImage.h"
#include "Filters/Morphology/MSkeleton.h"
#include "afxwin.h"

// CMSkeletonDlg dialog

class CMSkeletonDlg : public CDialog
{
	DECLARE_DYNAMIC(CMSkeletonDlg)

public:
	CMSkeletonDlg(CWnd* pParent = NULL);   // standard constructor
	CMSkeletonDlg(CxImage* pImage);
	virtual ~CMSkeletonDlg();

	inline void SetImage(CxImage* pImage) { m_pImage = pImage; }
	inline CxImage *GetImage() { return m_pImage; }

	void FitRect(CRect &frame, CSize img);
	CWnd* GetControlRect(CRect &rect, UINT nID);
	void ShowOriginalImage(CDC* pDC);
	void ShowResultImage(CDC* pDC);
// Dialog Data
	enum { IDD = IDD_DIALOG_MSKELETON };

protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support

	DECLARE_MESSAGE_MAP()

protected:
	CxImage* m_pImage;
	CxImage* m_pResultImage;

	CRect m_originalImageRect;
	CRect m_resultImageRect;

	CMSkeleton m_skeleton;
	BOOL m_bProcessed;

public:
	virtual BOOL OnInitDialog();
	afx_msg void OnPaint();
	afx_msg void OnBnClickedButtonSkeleton();

public:
	CStatic m_txtStatus;
	CButton m_btnSkeleton;
};
